import request from 'utils/request';

export interface IAddress {
  id: string;
  created_at: string;
  updated_at: string;
  address_name: string;
  // 其他字段...
}

interface IResult {
  list: IAddress[];
}

interface IParams {
  address_type: "装货地址" | "卸货地址";
  sort_field?: string;
  asc?: boolean;
  page_size?: number;
  page_num?: number;
}

export const getAddressList = async (params: IParams) => {
  const result = await request.post<IResult>('/api/v1/address/list', params);
  return result;
};
